package com.atguigu.tingshu.user.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

//@Component
public class KafkaTestConsumer {

//    @KafkaListener(topics = "c")
//    public void test(ConsumerRecord<String,String> record){
//        try {
//            System.out.println("消息Key = " + record.key());
//            System.out.println("消息的值 = " + record.value());
//            System.out.println("消息分片 = " + record.partition());
//            System.out.println("消息offset = " + record.offset());
//        }catch (Exception e){
//            long offset = record.offset();
//        }
//    }

}
